GtkFontButton: Make sure the dialog isn't destroyed on delete-event
authorRui Matos <tiagomatos@gmail.com>
Thu, 5 Dec 2013 20:35:36 +0000 (21:35 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 29 Sep 2014 02:07:48 +0000 (22:07 -0400)
The remaining code assumes that the dialog doesn't get destroyed, but
it actually does on delete-event.

In particular, the filter function and the preview text are lost as
soon as the dialog is created and thus when we create a new dialog we
don't have those properties to set on it anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=719936

gtk/gtkfontbutton.c

index 867d82fa55182f5a2a2322f4c2f145cb4f3cebef..7e068c40c1fd7ff81334835d5bc6f4c005e2d724 100644 (file)
@@ -1049,6 +1049,9 @@ gtk_font_button_clicked (GtkButton *button)
 
       g_signal_connect (font_dialog, "destroy",
                         G_CALLBACK (dialog_destroy), font_button);
+
+      g_signal_connect (font_dialog, "delete-event",
+                        G_CALLBACK (gtk_widget_hide_on_delete), NULL);
     }
   
   if (!gtk_widget_get_visible (font_button->priv->font_dialog))